﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Daphne.Controls
{
    /// <summary>
    /// Interaction logic for StateHoverButton.xaml
    /// </summary>
    public partial class StateHoverButton : UserControl
    {
        private bool _isOn = false;

        public StateHoverButton()
        {
            InitializeComponent();
            uxButton.Image = Image;
            uxButton.HoverImage = HoverImage;
        }

        public string Image
        { get; set; }

        public string HoverImage
        { get; set; }

        public string OnImage
        { get; set; }

        public string OnHoverImage
        { get; set; }

        public bool IsOn
        {
            get
            {
                return _isOn;
            }
            set
            {
                _isOn = value;
                if (_isOn == true)
                {
                    uxButton.Image = OnImage;
                    uxButton.HoverImage = OnHoverImage;
                    uxButton.ReloadImages();
                }
                else
                {
                    uxButton.Image = Image;
                    uxButton.HoverImage = HoverImage;
                    uxButton.ReloadImages();
                }
            }
        }

        public new string ToolTip
        {
            get
            {
                return (string)uxButton.ToolTip;
            }
            set
            {
                uxButton.ToolTip = value;
            }
        }

        public ICommand Command
        {
            get
            {
                return uxButton.Command;
            }
            set
            {
                uxButton.Command = value;
            }
        }
    }

}
